package com.example.administrator.jingpingou.bean;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by lenovo on 2016/8/29.
 */
public class NextThemeBean {

    /**
     * data : [{"num_iid":"42427503128","pic_url":"http://gw.alicdn.com/bao/uploaded/i1/TB1E7ywGpXXXXXlaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg","title":"韩版复古高领麻花毛衣女加厚宽松","origin_price":"199.00","now_price":"98.00","discount":"4.9","deal_num":"317"},{"num_iid":"42950107115","pic_url":"http://gw.alicdn.com/bao/uploaded/i2/TB1JnHYGVXXXXamXpXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg","title":"韩版复古麻花高领毛衣女套头","origin_price":"159.00","now_price":"99","discount":"6.1","deal_num":"335"},{"num_iid":"41963107221","pic_url":"http://gw.alicdn.com/bao/uploaded/i1/TB19xyBGFXXXXaNXXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg","title":"韩国宽松套头女士毛衣菱形加厚","origin_price":"98.00","now_price":"55","discount":"5.6","deal_num":"6473"},{"num_iid":"42168879724","pic_url":"http://gw.alicdn.com/bao/uploaded/i4/TB1eufWFVXXXXX7aXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg","title":"韩版短款高领套头毛衣复古高腰","origin_price":"499.00","now_price":"155","discount":"3.1","deal_num":"152"},{"num_iid":"42249737886","pic_url":"http://gw.alicdn.com/bao/uploaded/i2/TB1_EoQGXXXXXb0XVXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg","title":"韩版复古麻花编织高领毛衣套头","origin_price":"139","now_price":"115.90","discount":"7.8","deal_num":"105"},{"num_iid":"42590387613","pic_url":"http://gw.alicdn.com/bao/uploaded/i1/TB1vgR2GVXXXXbGXXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg","title":"复古韩国高领毛衣打底衫混色女","origin_price":"159.00","now_price":"129.90","discount":"8.2","deal_num":"341"},{"num_iid":"41879416336","pic_url":"http://gw.alicdn.com/bao/uploaded/i2/TB13.lWGXXXXXc.XXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg","title":"韩国秋冬新款复古麻花蝙蝠袖套头","origin_price":"199.00","now_price":"55","discount":"2.7","deal_num":"1399"},{"num_iid":"41434265987","pic_url":"http://gw.alicdn.com/bao/uploaded/i3/TB1JrZYGXXXXXaiXFXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg","title":"韩版毛呢外套女中长款毛呢大衣","origin_price":"342.00","now_price":"178","discount":"5.1","deal_num":"118"},{"num_iid":"43075628619","pic_url":"http://gw.alicdn.com/bao/uploaded/i3/TB10k7TGVXXXXcaXVXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg","title":"秋冬加厚毛呢外套女休闲大衣外套","origin_price":"298.00","now_price":"178","discount":"5.9","deal_num":"530"},{"num_iid":"42302492921","pic_url":"http://gw.alicdn.com/bao/uploaded/i2/TB1ddgxGXXXXXcoXVXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg","title":"东大门毛呢外套双排扣格子大衣","origin_price":"499.00","now_price":"179.00","discount":"3.6","deal_num":"27"},{"num_iid":"42045217708","pic_url":"http://gw.alicdn.com/bao/uploaded/i3/TB10JnrGXXXXXaoXVXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg","title":"韩版呢子大衣加厚女装修身显瘦","origin_price":"398.00","now_price":"228.00","discount":"5.7","deal_num":"247"},{"num_iid":"43157669325","pic_url":"http://gd3.alicdn.com/imgextra/i3/471594703/TB2HaE6bpXXXXXyXXXXXXXXXXXX_!!471594703.jpg_220x220.jpg","title":"韩版修身狐狸毛领短款毛呢外套","origin_price":"899.00","now_price":"338","discount":"3.7","deal_num":"6489"},{"num_iid":"42519391090","pic_url":"http://gd3.alicdn.com/imgextra/i3/2335167503/TB2dVjubXXXXXaTXXXXXXXXXXXX_!!2335167503.jpg_220x220.jpg","title":"韩版女装百搭复古羊角扣毛呢","origin_price":"198.00","now_price":"88.00","discount":"4.4","deal_num":"207"},{"num_iid":"42841970135","pic_url":"http://gw.alicdn.com/bao/uploaded/i4/TB1KHHoGVXXXXX7XpXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg","title":"冬季新款短款棉服韩版复古风","origin_price":"299.00","now_price":"159","discount":"5.3","deal_num":"120"},{"num_iid":"43136085303","pic_url":"http://gw.alicdn.com/bao/uploaded/i2/TB1HpMzGVXXXXX2XpXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg","title":"潮流军绿色中长款棉衣复古装","origin_price":"256","now_price":"199","discount":"4.9","deal_num":"118"}]
     * info : success
     */

    private String info;
    /**
     * num_iid : 42427503128
     * pic_url : http://gw.alicdn.com/bao/uploaded/i1/TB1E7ywGpXXXXXlaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg
     * title : 韩版复古高领麻花毛衣女加厚宽松
     * origin_price : 199.00
     * now_price : 98.00
     * discount : 4.9
     * deal_num : 317
     */

    private List<DataBean> data;

    public static NextThemeBean objectFromData(String str) {

        return new Gson().fromJson(str, NextThemeBean.class);
    }

    public static NextThemeBean objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), NextThemeBean.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public static List<NextThemeBean> arrayNextThemeBeanFromData(String str) {

        Type listType = new TypeToken<ArrayList<NextThemeBean>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public static List<NextThemeBean> arrayNextThemeBeanFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);
            Type listType = new TypeToken<ArrayList<NextThemeBean>>() {
            }.getType();

            return new Gson().fromJson(jsonObject.getString(str), listType);

        } catch (JSONException e) {
            e.printStackTrace();
        }

        return new ArrayList();


    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public List<DataBean> getData() {
        return data;
    }

    public void setData(List<DataBean> data) {
        this.data = data;
    }

    public static class DataBean implements Serializable {
        private String num_iid;
        private String pic_url;
        private String title;
        private String origin_price;
        private String now_price;
        private String discount;
        private String deal_num;

        public static DataBean objectFromData(String str) {

            return new Gson().fromJson(str, DataBean.class);
        }

        public static DataBean objectFromData(String str, String key) {

            try {
                JSONObject jsonObject = new JSONObject(str);

                return new Gson().fromJson(jsonObject.getString(str), DataBean.class);
            } catch (JSONException e) {
                e.printStackTrace();
            }

            return null;
        }

        public static List<DataBean> arrayDataBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<DataBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public static List<DataBean> arrayDataBeanFromData(String str, String key) {

            try {
                JSONObject jsonObject = new JSONObject(str);
                Type listType = new TypeToken<ArrayList<DataBean>>() {
                }.getType();

                return new Gson().fromJson(jsonObject.getString(str), listType);

            } catch (JSONException e) {
                e.printStackTrace();
            }

            return new ArrayList();


        }

        public String getNum_iid() {
            return num_iid;
        }

        public void setNum_iid(String num_iid) {
            this.num_iid = num_iid;
        }

        public String getPic_url() {
            return pic_url;
        }

        public void setPic_url(String pic_url) {
            this.pic_url = pic_url;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getOrigin_price() {
            return origin_price;
        }

        public void setOrigin_price(String origin_price) {
            this.origin_price = origin_price;
        }

        public String getNow_price() {
            return now_price;
        }

        public void setNow_price(String now_price) {
            this.now_price = now_price;
        }

        public String getDiscount() {
            return discount;
        }

        public void setDiscount(String discount) {
            this.discount = discount;
        }

        public String getDeal_num() {
            return deal_num;
        }

        public void setDeal_num(String deal_num) {
            this.deal_num = deal_num;
        }
    }
}
